package dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import pojo.po.Role;

import java.util.List;

public interface RoleMapper {

    @Select("select * from t_role limit #{index},#{size}")
   List<Role> findAllRoles(@Param("index") Integer index, @Param("size") Integer pageSize);

    @Select("select r.name from t_role r where id in(select ur.role_id from t_user_role ur where user_id = #{uid})")
   List<Role> findByUid(String uid);
    @Select("select r.name,r.id from t_role r")
    List<Role> findAllRolesName();
}
